package Exception;

public class TestDemo {
    public static void main(String[] args) {
        int[] arr={1,2,3,4,5};
        System.out.println(arr[4]);
        System.out.println((arr[0]));

        try{
            System.out.println(arr[4]);
            String str="null";
            String str1="abc";
            System.out.println(str.length());
            System.out.println(str1);
            //System.out.println(Integer.parseInt(str));

        }
//        catch(ArrayIndexOutOfBoundsException e)
        catch(Exception e){
            System.out.println("出现未知异常");
        }
        finally {
            System.out.println("程序结束");
        }
//        String str="null";
//        System.out.println(str.length());
    }
}
